package cn.codeinn.generator.entity;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;

import cn.vkits.core.util.StrUtil;

public class Table {
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;
	private String engine;
	private String tableComment;
	private String tableName;

	@JsonProperty(access = Access.WRITE_ONLY)
	private String tablePrefix;
	@JsonProperty(access = Access.WRITE_ONLY)
	private String packageName;
	@JsonProperty(access = Access.WRITE_ONLY)
	private String moduleName;
	@JsonProperty(access = Access.WRITE_ONLY)
	private List<String> business;
	@JsonProperty(access = Access.WRITE_ONLY)
	private List<String> tables;

	public String getTablePrefix() {
		return StrUtil.isBlank(tablePrefix) ? "sys_" : tablePrefix;
	}

	public void setTablePrefix(String tablePrefix) {
		this.tablePrefix = tablePrefix;
	}

	public String getPackageName() {
		return StrUtil.isBlank(packageName) ? "com.vhub" : packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

	public String getModuleName() {
		return StrUtil.isBlank(moduleName) ? "core" : moduleName;
	}

	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getEngine() {
		return engine;
	}

	public void setEngine(String engine) {
		this.engine = engine;
	}

	public String getTableComment() {
		return tableComment;
	}

	public void setTableComment(String tableComment) {
		this.tableComment = tableComment;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public List<String> getBusiness() {
		return business;
	}

	public void setBusiness(List<String> business) {
		this.business = business;
	}

	public List<String> getTables() {
		return tables;
	}

	public void setTables(List<String> tables) {
		this.tables = tables;
	}
}
